param 
(
  $ShowBuild
)

Process
{

  $version = [version] $_
  
  $os = switch ($version.Major, $version.Minor -join '.') {
    '10.0' { 'Windows 10/Windows Server 2016' }
    '6.3' { 'Windows 8.1/Windows Server 2012 r2' }
    '6.2' { 'Windows 8/Windows Server 2012' }
    '6.1' { 'Windows 7/Windows Server 2008 r2' }
    '6.0' { 'Windows Vista/Windows Server 2008' }
    '5.2' { 'Windows XP/Windows Server 2003 r2' }
    Default { 'Windows XP/Windows Server 2003 or older'}
  }

  if ($ShowBuild) {
    $os + ' build ' + $version.Build
  } else {
    $os
  }
}